package com.qf.cm.service.impl;

import com.qf.cm.dao.ProjectDao;
import com.qf.cm.pojo.Project;
import com.qf.cm.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 公用常量
 * @Data: 2022/9/7 11:29
 * @Pacakge: com.qf.cm.service.impl
 * @ClassName: ProjectServiceImpl
 * @Author: fan
 */
@Service
public class ProjectServiceImpl implements ProjectService {
    @Autowired
    private ProjectDao projectDao;

    /**
     * 查询所有已激活的工程
     * @return
     */
    @Override
    public List<Project> findAllProject() {
        return  projectDao.findAllProject();
    }

    /**
     * 通过pid查询与之对应的工程
     * @param pid
     * @return
     */
    @Override
    public Project findProjectById(Integer pid) {
        return projectDao.findProjectByPid(pid);
    }

    /**
     * 修改项目
     * @param project
     * @return
     */
    @Override
    public int updateProject(Project project) {
       int i =  projectDao.updateProject(project);
        return i;
    }

    /**
     * 查询所有
     * @return
     */
    @Override
    public List<Project> findAll() {
        return projectDao.findAll();
    }

    /**
     * 查询所有stage以及project
     * @return
     */
    @Override
    public List<Project> findProjectAndStages() {
        return projectDao.findProjectAndStages();
    }

}
